Multifractal Analysis of Measures Arising from Random Substitutions

We study regularity properties of frequency measures arising from random substitutions, which are a generalisation of (deterministic) substitutions where the substituted image of each letter is chosen independently from a fixed finite set. In particular, for a natural class of such measures, we derive a closed-form analytic formula for the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L^q$$\end{document}Lq-spectrum and prove that the multifractal formalism holds. This provides an interesting new class of measures satisfying the multifractal formalism. More generally, we establish results concerning the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L^q$$\end{document}Lq-spectrum of a broad class of frequency measures. We introduce a new notion called the inflation word \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L^q$$\end{document}Lq-spectrum of a random substitution and show that this coincides with the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L^q$$\end{document}Lq-spectrum of the corresponding frequency measure for all \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$q \ge 0$$\end{document}q≥0. As an application, we obtain closed-form formulas under separation conditions and recover known results for topological and measure theoretic entropy.


INTRODUCTION
A substitution is a combinatorial object consisting of a finite alphabet A along with a set of transformation rules.The theory of substitutions, along with statistical properties of the system under repeated iteration, is a large and actively researched field at the interface of combinatorics and symbolic dynamics.A thorough introduction to the statistical properties and dynamics of substitutions can be found in [BG13;Que87].Associated with a (deterministic) substitution is a frequency measure, which encodes the frequency of subwords under repeated iteration.Notably, the corresponding subshift supporting this measure has zero topological entropy, and the frequency measure is the unique ergodic measure supported on this subshift.
Random substitutions are a generalisation of (deterministic) substitutions [GL89] where we apply a transformation rule to each letter randomly and independently chosen from a finite set of possibilities.Similarly to the deterministic case, subshifts associated with random substitutions support ergodic frequency measures which capture the expected rate of occurrence of subwords under random iteration.But in contrast to the deterministic case, the corresponding subshift typically has positive topological entropy and supports uncountably many ergodic measures.Random substitutions include examples exhibiting deterministic behaviour, while also including examples which are subshifts of finite type [GRS19].Moreover, there is a large amount of intermediate behaviour: subshifts of random substitutions can simultaneously exhibit long range correlation [BSS18] (an indication of order) and positive topological entropy [Goh20] (an indication of disorder).
As a generalisation of substitutions, random substitutions model quasicrystals with errors; namely, crystalline structures with local disorder [AL10; GL89].Random substitutions have also proved a useful tool for modelling fractal percolation [DG88; DM90; DW01].Properties of these physical phenomena can be associated with almost sure properties of the frequency measure corresponding to the underlying random substitution [Pey81].
In this paper, we study the fine scaling properties of frequency measures associated with random substitutions from the perspective of multifractal analysis.This perspective is relevant in a wide variety of contexts, such as the geometry of fractal sets and measures and in dynamical systems, with typical applications to geometric measure theory and number theory.In our setting, our primary objects of study are the L q -spectrum, which is a parametrised family of quantities which capture the inhomogeneous scaling properties of a measure, and the local dimension, which capture the exponential growth rate of a measure around a point.The L q -spectrum and local dimensions are related through a heuristic relationship known as the multifractal formalism, first introduced and studied in a physical context in [HJK+86].It is an important and well-studied question to determine settings in which the multifractal formalism holds, and to determine qualitative conditions describing its failure.
Much of the work on multifractal analysis has been done in the setting of local dimensions of self-similar measures (for some examples, see [AP96; Fen05; FL09; LN99; Shm19]) and Birkhoff sums of potentials in dynamical systems with a finite type property (see, for example, [FFW01; Kes01; PW97; PW99] and the reference therein).As a notable recent example, in P. Shmerkin's recent proof of the Furstenberg's intersection conjecture [Shm19], he computes the L q -spectrum of a large class of dynamically self-similar measures and relates such results to the multifractal analysis of slices of sets.This information about L q -spectra also implies L p -smoothness properties in the question of absolute continuity of Bernoulli convolutions (see [Var18] for some background on this classic problem).For more detail on the geometry of measures and multifractal analysis, we refer the reader to the foundational work by L. Olsen [Ols95] and the classic texts of K. Falconer [Fal97] and Ya.Pesin [Pes98].
Returning to our setting, substitution dynamical systems have characteristic features of (dynamical) self-similarity, but in many cases are far from being ergodic measures on shifts of finite type.More generally, frequency measures provide a rich family of shift-invariant ergodic measures which exhibit interesting and unique properties in symbolic dynamics in a natural way.For example, it was proved in [GMR+23, Theorem 4.8] that for a certain class of random substitutions, the corresponding subshift supports a frequency measure that is the unique ergodic measure of maximal entropy.However, this measure is not a Gibbs measure with respect to the zero potential, and therefore the system does not satisfy the common specification property, which is a well-known strategy for proving intrinsic ergodicity of symbolic dynamical systems (see [CT21] and the references therein).Moreover, there are examples of random substitutions such that the corresponding subshift supports multiple ergodic measures of maximal entropy [GS20, Example 6.5].More generally, many key properties of frequency measures associated with random substitutions are poorly understood.
In this paper, we derive symbolic expressions for the L q -spectrum of frequency measures associated with random substitutions under certain weak assumptions.
Then under an additional assumption (recognisability), we prove a closed-form analytic expression for the L q -spectrum and a variational formula which together imply the multifractal formalism.Recognisable random substitutions exhibit novel properties not witnessed by other classes of measures for which the multifractal formalism is well-understood: it often happens that the unique frequency measure of maximal entropy is not a Gibbs measure with respect to the zero potential and the corresponding subshift is not sofic.The techniques and results provide important new perspectives on the geometry and dynamics of the respective measures.
1.1.Entropy and L q -spectra.For a Borel probability measure in a compact metric space, the L q -spectrum is a well-studied quantity which encodes the scaling properties of the measure, in a weak sub-exponential sense.Specifically, the L q -spectrum of µ is given by τ µ (q) = lim inf r→0 log sup i µ B(x i , r) q log r .
where the supremum is taken over 2r-separated subsets {x i } i of the support of µ.
The L q -spectrum encodes information about the local scaling of the measure µ.We define the local dimension of µ at x by dim loc (µ, x) = lim r→0 log µ B(x, r) log r when the limit exists.We then define the multifractal spectrum of µ by f µ (α) = dim H {x ∈ X : dim loc (µ, x) = α} .
In general, the structure of the set of local dimensions can be very complex-for example, the level sets are often dense uncountable subsets of the support of µ.However, the "multifractal miracle" is the phenomenon that, even though the level sets are very complex, the multifractal spectrum is often a concave analytic function of α.
In fact, the multifractal spectrum and the L q -spectrum are related through a heuristic relationship called the multifractal formalism [HJK+86], which speculates that under certain regularity assumptions, the multifractal spectrum is given by the concave conjugate of the L q -spectrum, that is the quantity Generally speaking, τ * µ (α) ≥ f µ (α) [LN99]: in particular, the slopes of the asymptotes of the L q -spectrum bound the exponential scaling of measures of balls B(x, r) uniformly for all x ∈ supp µ.
In our specific setting, where our metric space is the two-sided shift A Z and the measure µ is ergodic, the local dimension is precisely the scaling rate of the information function of µ.In fact, the Shannon-McMillan-Breiman theorem states that the local dimension of the measure (with an appropriate choice of the metric) is almost surely the entropy of the measure.Thus the L q -spectrum provides uniform control over the scaling rate of the information function.More details about these notions are given in §2.
1.2.Random substitutions.A (deterministic) substitution is a rule which replaces each symbol in a finite or infinite string over an alphabet A with a finite word over the same alphabet.Random substitutions generalise this notion by substituting a randomly chosen word (according to a fixed finite distribution) independently for each letter.We can also think of a random substitution as a (deterministic) set-valued substitution ϑ, together with a choice of probabilities.
For example, given p ∈ (0, 1), the random Fibonacci substitution ϑ p is defined by To a given (primitive) random substitution ϑ P , one can canonically associate a subshift X ϑ of the two-sided shift A Z along with an ergodic frequency measure µ P , which quantifies the relative occurrence of a given word under repeated application of the random substitution.
As highlighted in the introduction, primitive random substitutions give rise to subshifts and measures with a wide variety of properties.As a result, we impose additional conditions.
Our main assumption, which we call compatibility (see §2.7), asserts that for each a ∈ A, the number of occurrences of each b ∈ A is identical in every possible substituted image of a.For example, the random Fibonacci substitution is compatible since in all the possible images of a, a occurs once and b occurs once.The key feature of compatibility is that the one can define a deterministic substitution matrix, such that the Perron-Frobenius eigenvalue is the asymptotic growth rate of lengths of words under repeated substitution, and the corresponding right eigenvector encodes the asymptotic frequency with which the individual letters appear.Compatibility is a common assumption: for example, it is assumed in the main results of [BSS18; Goh20; MRS+23; Rus20].
Another standard assumption is recognisability (see §2.9), which heuristically states that each element of the subshift has a unique preimage in the subshift.Recognisability precludes the existence of periodic points [Rus20] and is one of the assumptions required to to establish intrinsic ergodicity in [GMR+23].It is also assumed in the main results of [FRS22+;MRS+23].

Statement and discussion of main results
. We now give concise statements of the main results in this paper.We refer the reader to §2 for full statements of the notation and definitions used in this section.
Fix a random substitution ϑ P and let λ and R denote the Perron-Frobenius eigenvalue and corresponding right eigenvector of the substitution matrix of ϑ P , respectively.Given q ∈ R and k ∈ N, define We define the inflation word L q -spectrum of ϑ P by We similarly define the upper variant T ϑ,P by taking a limit superior in place of the limit inferior.Throughout, µ P will denote the frequency measure associated with ϑ P .Heuristically, the inflation word spectrum approximates the frequency measure µ P by the probability distribution on the iterated system, with an appropriate normalisation.
Our main general result bounding the L q -spectrum is the following, which states that T ϑ,P and τ µ P coincide for all q ≥ 0, and moreover provides bounds on τ µ P in terms of the functions φ k for all q ∈ R.
Theorem A. Let ϑ P = (ϑ, P ) be a primitive and compatible random substitution with corresponding frequency measure µ P .Then the limits defining τ µ P (q) and T ϑ,P (q) exist and coincide for all q ≥ 0.Moreover, 1.For all 0 ≤ q ≤ 1, and (λ −k φ k (q)) ∞ k=1 converges monotonically to τ µ P (q) from above.2. For all q ≥ 1, and (λ −k φ k (q)) ∞ k=1 converges monotonically to τ µ P (q) from below.3.For all q < 0, The notion of compatibility is defined in §2.7.For q < 0, it is not true in general that τ µ P (q) and T ϑ,P (q) coincide (a counterexample is given in Example 5.2): the "nonuniqueness of cutting points" allows collisions in the averaging procedure in the construction of the measure (see Lemma 2.12).In other words, the corresponding upper bound in (1.3) does not hold in general.
If ϑ P also satisfies the disjoint set condition, or the identical set condition with identical production probabilities (see Definition 2.13), then a closed-form expression can be obtained for T ϑ,P (see Proposition 3.1).By combining this result with Theorem A, we obtain the following corollary.

Corollary B.
Let ϑ P be a primitive and compatible random substitution with corresponding frequency measure µ P .Then for all q ≥ 0: 1.If ϑ P satisfies the disjoint set condition, then 2. If ϑ P satisfies the identical set condition and has identical production probabilities, then In particular, under the disjoint set condition or identical set condition with identical production probabilities, the L q -spectrum is analytic on (0, ∞).
As a direct application of Theorem A, we obtain new proofs of known results on measure-theoretic and topological entropy.
(a) We obtain the main result of [Goh20] on topological entropy, which states that for subshifts of primitive and compatible random substitutions, the topological entropy can be characterised in terms of the asymptotic growth rate of inflation words.
(b) We also obtain the characterisation of (measure-theoretic) entropy obtained in [GMR+23, Theorem 3.3] for frequency measures corresponding to primitive and compatible random substitutions.We note that the main results in [GMR+23] do not require the assumption of compatibility.This is described in the following corollary.
Corollary C. Let ϑ P = (ϑ, P ) be a primitive and compatible random substitution with associated subshift X ϑ and frequency measure µ P .
1.The limit exists and is equal to h top (X ϑ ).
2. The L q -spectrum of µ P is differentiable at 1.Moreover, the limit exists and is equal to h µ P (X ϑ ) = dim H µ P = τ ′ µ P (1).We now turn our attention to the multifractal spectrum.While τ µ P (q) and T ϑ,P (q) do not coincide in general for q < 0, if the random substitution that gives rise to the frequency measure µ P is additionally assumed to be recognisable (see Definition 2.14), then the limits defining τ µ P (q) and T ϑ,P (q) both exist and coincide for all q ∈ R.Moreover, under recognisability, we prove that the multifractal spectrum is the concave conjugate of the L q -spectrum: in other words, the multifractal formalism holds for any associated frequency measure µ P .In particular, we conclude that f µ P is a concave analytic function.
In fact, in Proposition 4.5 we prove a stronger variational formula for the multifractal spectrum.For each α ∈ R, we construct measures ν such that dim H ν ≥ τ * (α) and dim loc (µ P , x) = α for ν-a.e.x ∈ X ϑ .In particular, we can take the measures to be frequency measures associated with permissible probabilities for the substitution ϑ.Theorem D. Let ϑ P be a primitive, compatible, and recognisable random substitution with corresponding frequency measure µ P .Then for all q ∈ R, Moreover, f µ P (α) = τ * µ P (α) is concave and analytic on its support.In fact, for each α ∈ R such that f µ P (α) ≥ 0, there are permissible probabilities Q such that f µ P (α) = dim H µ Q and dim loc (µ P , x) = α for µ Q -a.e.x ∈ X ϑ .
To conclude this section, we observe that our results on L q -spectra also give uniform bounds on the exponential scaling rate of the frequency measures.The following result is a direct application of Theorem A and Theorem D, combined with bounds on the possible local dimensions (from Proposition 4.4).

Corollary E.
Let ϑ P = (ϑ, P ) be a primitive, compatible, and recognisable random substitution.Then and for all x ∈ X ϑ , α min ≤ dim loc (µ P , x) ≤ dim loc (µ P , x) ≤ α max .Moreover, In particular, when the probabilities P are chosen so that for each a ∈ A, P[ϑ P (a) = s] = 1/#ϑ(a) for all s ∈ ϑ(a), then the L q -spectrum is the line with slope h top (X ϑ ) passing through (1, 0).Thus the local dimension of µ P exists at every x ∈ X ϑ and is given by the constant value α min = α max .This can be rephrased in terms of a weak Gibbs-type property, which says that every sufficiently long legal word (with length depending only on ϵ > 0) satisfies Of course, similar one-sided results hold for q ≥ 0 only under the assumption of compatibility, by iterating the formula for φ k and taking an appropriate maximum at each level.In fact, since τ µ P (q) is differentiable at 1, with derivative giving the entropy, and since h top (X ϑ ) = τ µ P (0), it follows that µ P is a measure of maximal entropy if and only if τ ′ µ P (q) exists and is constant on the interval (0, 1).

Further work.
We conclude the introduction with a list of comments and potentially interesting questions.
1. What is the L q -spectrum for a compatible substitution when q < 0? We do not know this even for the random substitution given in Example 5.1, which satisfies the identical set condition with identical production probabilities.
Obtaining results for q < 0 is substantially more challenging, since the sum in τ µ P (q) depends on the measure of cylinders with very small (but non-zero) measure.For example, in the self-similar case, without the presence of strong separation assumptions, little is known (in contrast to the q ≥ 0 case).
2. What happens without compatibility?Do the formulas in Theorem A hold in general?In [GMR+23], it suffices to use an almost sure version of Lemma 2.9.However, since the L q -spectrum is sensitive to scaling at individual points as q tends to ±∞, such an almost sure result in our case is insufficient.
3. Outside the disjoint set condition and the identical set condition, what can be said about differentiability of the L q -spectrum?For q ≥ 0, we give the L q -spectrum as a uniform limit of analytic functions: however, aside from the exceptional point q = 1 where we can say more, this is not enough to give information about differentiability.
4. Can the assumption of recognisability in Theorem D be relaxed to a weaker condition, such as the disjoint set condition (see Definition 2.13)?
5. Can the error term in (1.4) be determined precisely, up to a constant?The approximate Gibbs-type bounds discussed following Corollary E are closely related to the bounds used in the proof of intrinsic ergodicity given in [GMR+23, Theorem 4.8].It could be worth exploring the relationship between intrinsic ergodicity and Gibbs-type properties given by the L qspectrum.

PRELIMINARIES
In this section we introduce the key notation and definitions that we will use throughout the paper.After introducing some basic notation, in §2.2 we introduce symbolic dynamics on the two-sided shift, as well as our notions of entropy and dimension.In §2.3 we present the key definitions and basic results from multifractal analysis that we work with throughout, including the definitions of the L q -spectrum and local dimensions of a measure.Then, in the following sections we provide an introduction to random substitutions and their associated dynamical systems.In §2.5 we give the definition of a random substitution via its action on words, and define the subshift associated to a random substitution.Then, in §2.6 and §2.7, we define what it means for a random substitution to be primitive and compatible and present the key properties of such random substitutions.In §2.8, we give the definition of the frequency measure associated to a random substitution and state a key result used in the proof of our main results which relates the measures of cylinder sets via the action of the random substitution.Finally, in §2.9, we define what it means for a substitution to satisfy the disjoint or identical set condition, and introduce recognisable random substitutions.
2.1.Symbolic notation.Throughout, we use the following symbolic notation, which is essentially the same as the notation used in [BG13; LM95].For a set B, we let #B be the cardinality of B and let F(B) be the set of non-empty finite subsets of B.
We fix an alphabet A = {a 1 , . . ., a d }, for some d ∈ N, which is a finite set of letters a i , and equip it with the discrete topology.Then a word u with letters in A is a finite concatenation of letters, namely u = a i 1 • • • a in for some n ∈ N. We write |u| = n for the length of the word u, and for m ∈ N, we let A m denote the set of all words of length m with letters in A.
We set A + = m∈N A m and let denote the set of all bi-infinite sequences with elements in A, and endow A Z with the product topology.We also fix a metric on A Z as follows.Given points x = (x n ) n∈Z and y = (y n ) n∈Z , let N (x, y) = sup{n ∈ Z : x j = y j for all |j| ≤ n} and let d(x, y) = e −2N (x,y)−1 .The space X is compact with topology generated by the metric.
We will frequently write sequences , with the corresponding notation for finite sequences.If i and j ∈ Z with i ≤ j, and . For u and v ∈ A + , we set |v| u to be the number of (possibly overlapping) occurrences of u as a subword of v.
for some n and m ∈ N, we write uv for the concatenation of u and v.The abelianisation of a word u ∈ A + is the vector Φ(u) ∈ N #A 0 , defined by Φ(u) a = |u| a for all a ∈ A.

Dynamics, entropy and dimension.
We equip the space A Z with invertible dynamics from the left-shift map S : A Z → A Z .Throughout, we work with a subshift X ⊂ A Z , which is compact and shift-invariant, that is S −1 (X) = X.Then µ will denote an ergodic and S-invariant Borel probability measure with support contained in X.
The metric structure on A Z enables us to define the Hausdorff dimension of Borel subsets of X.Using this, we define the Hausdorff dimension of µ to be the quantity where the infimum is taken over Borel sets E. Here, we use Hausdorff dimension as inherited from the underlying metric; though it would also be appropriate to use Bowen's generalisation of topological entropy to non-compact sets [Bow74].We also define the lower local dimension of µ at x by We define the upper local dimension dim loc (µ, x) analogously using the limit superior in place of the limit inferior, and when the limits coincide, we refer to the shared quantity as the local dimension and denote it by dim loc (µ, x).
Local dimensions and Hausdorff dimension are closely related: the same proof as given, for instance, in [Fal97, Proposition 10.1] implies that

Now fix a partition ξ so that with ξ
generates the Borel σ-algebra on X.We recall that the entropy of µ with respect to S is given by where, by the classical Kolmogorov-Sinaȋ theorem, the quantity does not depend on the choice of partition.Now given x ∈ X, let ξ k (x) denote the unique element in the partition ξ k containing x. Then the Shannon-McMillan-Breiman theorem states that the entropy of µ is almost surely the information rate of µ, that is for µ-a.e.x ∈ X, We refer the reader to [Kel98, Theorem 3.2.7]for a proof and more background on this topic.Now suppose ξ = {E a } a∈A is the partition of X where E a = {(x n ) n∈Z ∈ X : x 0 = a}.For the remainder of this paper, ξ will always denote this partition.Then given and therefore where both limits exist if either limit exists.Since the limit on the right is µ almost surely h µ (X), it follows from (2.1) that dim H µ = h µ (X).
Finally, the topological entropy of X is given by Of course, h top (X) = dim B X, the box counting dimension of X.

2.3.
L q -spectra and smoothness.Given q ∈ R, we define S µ,r (q) = sup q where P(r) is the set of discrete 2r-separated subsets of X, that is We then define the L q -spectrum of µ to be the function For convenience, we also denote the upper variant τ µ (q) by taking a limit superior in place of the limit inferior.It is a standard consequence of Hölder's inequality that τ µ (q) is a concave increasing function of q (note that this need not hold for τ µ (q)).
Of course, the preceding definitions hold more generally in an arbitrary metric space, but in our particular setting we can rephrase the L q -spectrum in terms of more familiar sums over cylinders.Recall that ξ denotes the partition of X ϑ into cylinders at 0 corresponding to the letters in A. Then set Since distinct elements in the partition ξ k are e −(2k+1) -separated, It follows immediately that with the analogous result for τ µ (q).In particular, τ µ (0) = h top (X) assuming µ is fully supported on X.
Finally, by shift invariance, we can characterise the subshift X in terms of a language on X.Given n ∈ N, we set Of course, by shift invariance, there is a measure-preserving bijection between L 2n+1 (X) and X n , so it follows again that We will primarily use this characterisation throughout the paper.We first list some basic properties of the L q -spectrum of the measure µ.Here, (a) is a direct consequence of Hölder's inequality, (b) is standard (see, for example, [Shm19, Lemma 1.4]) and (c) was proved in [FLR02, Theorem 1.4].
Lemma 2.1.Let µ be a shift-invariant measure on X.
(a) The L q -spectrum τ µ (q) is continuous, increasing and concave on R.
(b) Let α min = lim q→∞ τ µ (q)/q and α max = lim q→−∞ τ µ (q)/q.Then for every s < α min ≤ α max < t, all n sufficiently large and u ∈ L n , e −tn ≤ µ([u]) ≤ e −sn .In particular, the local dimensions satisfy (c) The left and right derivatives of In fact, (a) gives intuition for why the L q -spectrum encodes smoothness: rather than obtain almost sure information on local dimensions, the L q -spectrum contains uniform information about local dimensions.Finally, we prove a simple result concerning the L q -spectrum which will be useful later in the paper.Lemma 2.2.Let ζ > 1 be arbitrary.Then Proof.Of course, it always holds that First, let q < 0 and let n ∈ N be arbitrary.Let k n be minimal so that ⌊ζk n ⌋ ≥ n.
Observe that there is some which gives (2.2) for q < 0 since lim n/k n = ζ.
Similarly, for q ≥ 0, since there are at most This gives (2.2) for q ≥ 0.
The arguments for (2.3) follow analogously by choosing k n maximal so that ⌊ζk n ⌋ ≤ n. □ 2.4.Multifractal spectrum and multifractal formalism.The L q -spectrum of a measure is related to the (fine) multifractal spectrum.Let µ be a shift-invariant measure on a subshift X.We recall that the local dimension of µ at x ∈ X is given by when the limit exists.Given α ∈ R, set We then define the multifractal spectrum of µ by The multifractal spectrum is related to the L q -spectrum by the following result.Let g : R → R ∪{−∞} be a concave function.For x ∈ R, we let g + (x) (resp.g − (x)) denote the right (resp.left) derivative of g at x.Such limits necessarily exist by concavity.We denote the subdifferential of g at x by ∂g(x) = [g + (x), g − (x)].We then recall that the concave conjugate of g is given by Note that g * is always concave since it is the infimum of a family of affine functions.For more detail concerning the theory of concave functions, we refer the reader to [Roc70].Now, we say that µ satisfies the multifractal formalism when f µ = τ * µ .In general, the multifractal formalism need not hold, but it is well-known that the concave conjugate of the L q -spectrum is an upper bound for the multifractal spectrum.For the convenience of the reader, we provide a short self-contained proof, which follows the main ideas of [LN99, Theorem 4.1].

Example 2.5 (Random Fibonacci).
Let A = {a, b}, and let p ∈ (0, 1).The random Fibonacci substitution ϑ P = (ϑ, P ) is the random substitution given by ϑ P : In the following we describe how a random substitution ϑ P determines a (countable state) Markov matrix Q, indexed by A + ×A + .We interpret the entry Q u,v as the probability of mapping a word u to a word v under the random substitution.Formally, Q a i ,s (i,j) = p i,j for all j ∈ {1, . . ., r i } and We extend the action of ϑ P to finite words by mapping each letter independently to one of its realisations.More precisely, given n ∈ denote the set of all decompositions of v into n individual words and set In words, ϑ P (u) = v with probability Q u,v .
For u ∈ A + , let (ϑ n P (u)) n∈N be a stationary Markov chain on some probability space (Ω u , F u , P u ), with Markov matrix given by Q; that is, for all v and w ∈ A + , and n ∈ N. In particular, for all u and v ∈ A + , and n ∈ N. We often write P for P u if the initial word is understood.In this case, we also write E for the expectation with respect to P. As before, we call v a realisation of to be the set of all realisations of ϑ n P (u).Conversely, we may regard ϑ n P (u) as the set ϑ n (u) endowed with the additional structure of a probability vector.If u = a ∈ A is a letter, we call a word v ∈ ϑ k (a) a level-k inflation word, or exact inflation word.
To a given random substitution ϑ P = (ϑ, P ) one can associate a subshift.First, we say that a word u ∈ A + is (ϑ-)legal if there exists an a i ∈ A and k ∈ N such that u appears as a subword of some word in ϑ k (a i ).We define the language of ϑ by L ϑ = {u ∈ A + : u is ϑ-legal} and, for w ∈ A + ∪ A Z , we let L(w) = {u ∈ A + : u ◁ w} denote the language of w.
Definition 2.6.The random substitution subshift of a random substitution ϑ P = (ϑ, P ) is the system (X ϑ , S), where X ϑ = {w ∈ A Z : L(w) ⊆ L ϑ } and S denotes the (left) shift map, defined by S(w) i = w i+1 for each w ∈ X ϑ .
Under very mild assumptions, the space X ϑ is non-empty [GS20].This holds, for example, if the generating random substitution is primitive (we give a definition in §2.6).We endow X ϑ with the subspace topology inherited from A Z , and since X ϑ is defined in terms of a language, it is a compact S-invariant subspace of A Z .Hence, X ϑ is a subshift.For n ∈ N, we write L n ϑ = L ϑ ∩ A n and L n (w) = L(w) ∩ A n to denote the subsets of L ϑ and L(w), respectively, consisting of words of length n.The set-valued function ϑ naturally extends to X ϑ , where for The notation X ϑ reflects the fact that the random substitution subshift does not depend on the choice of (non-degenerate) probabilities P .In fact, this is the case for many structural properties of ϑ P .In these cases, one sometimes refers to ϑ instead of ϑ P as a random substitution, see for instance [Goh20; GRS19; Rus20; RS18].On the other hand, for some applications, one needs additional structure on the probability space.In fact, there is an underlying branching process, similar to a Galton-Watson process, that allows one to construct more refined random variables, see [GS20] for further details.The measure theoretic properties we consider are typically dependent on the choice of probabilities; however, some of the auxiliary results we use only depend on the set-valued substitution ϑ.To avoid confusion, for results where there is no dependence on the choice of probabilities we will give the statement in terms of the set-valued substitution ϑ and omit the dependence on P in the notation.

Primitive random substitutions.
A standard assumption in the study of substitutions (both deterministic and random) is primitivity.Given a random substitution ϑ P = (ϑ, P ) over an alphabet A = {a 1 , . . ., a d } with cardinality d ∈ N, we define the substitution matrix M = M ϑ P ∈ R d×d of ϑ P by Since M has only non-negative entries, it has a real eigenvalue λ of maximal modulus.Observe that λ ≥ 1, with λ = 1 precisely if M is column-stochastic, so that the random substitution is non-expanding.To avoid this degenerate situation, we assume that λ > 1.If the matrix M is primitive (that is if there exists a k ∈ N such that all the entries of M k are positive), the Perron-Frobenius theorem gives that λ is a simple eigenvalue and that the corresponding (right) eigenvector R = (R 1 , . . ., R d ) can be chosen to have strictly positive entries.We will normalise this eigenvector so that ∥R∥ 1 = 1.We refer to λ as the Perron-Frobenius eigenvalue of the random substitution, ϑ P , with corresponding Perron-Frobenius eigenvector R.
Definition 2.7.We say that ϑ P is primitive if M = M ϑ P is primitive and its Perron-Frobenius eigenvalue satisfies λ > 1.
We emphasise that for a random substitution ϑ P , being primitive is independent of the (non-degenerate) choice of probabilities P .In this sense, primitivity is a property of ϑ rather than ϑ P .
Since M k ϑ P = M ϑ k P , the Perron-Frobenius eigenvalue of ϑ k P is λ k .

Compatible random substitutions.
Another standard assumption in the study of random substitutions is compatibility, which gives that exact inflation words have a well-defined abelianisation.In particular, the matrix of a compatible random substitution is independent of the choice of probabilities, so the letter frequencies are uniform and do not depend on the realisation.As discussed in the introduction, the existence of uniform letter frequencies is fundamental in the proofs of our main results.
Compatibility is independent of the choice of probabilities, and a random substitution ϑ P = (ϑ, P ) is compatible if and only if for all u ∈ A + , we have that |s| a = |t| a for all s and t ∈ ϑ(u), and a ∈ A. We write |ϑ(u)| a to denote this common value, and let |ϑ(u)| denote the common length of words in ϑ(u).For convenience, we write |ϑ| = max a∈A |ϑ(a)|.For a random substitution that is both primitive and compatible, the (uniform) letter frequencies are encoded by the right Perron-Frobenius eigenvector of the substitution matrix, which by compatibility is independent of the choice of probabilities.In particular, we have the following (see [Que87] for a proof in the deterministic case, which also holds in the random case by compatibility).
Lemma 2.9 (Letter frequency bounds).If ϑ P is a primitive and compatible random substitution, then for all ε > 0 there is an integer N such that every word v of length at least N satisfies The random Fibonacci substitution defined in Example 2.5 is compatible, since Φ(ab) = Φ(ba) = (1, 1).It is also primitive, since the square of its substitution matrix is positive.For any choice of probabilities, the right Perron-Frobenius eigenvector is given by (τ −1 , τ −2 ), where τ denotes the golden ratio.In terms of letter frequencies, this means that in all sufficiently long legal words, approximately τ −1 proportion of the letters are a and τ −2 proportion are b.
The following consequence of Lemma 2.9 is useful in the proof of Theorem A.
Lemma 2.10.Let ϑ P = (ϑ, P ) be a primitive and compatible random substitution and let q ≥ 1.For all ε > 0, there is an M ∈ N such that for every m ≥ M and v ∈ L m ϑ , .
For q ≤ 1, the same result holds with reversed inequalities.
Proof.Since ϑ P is compatible, the cutting points of inflation tiles are welldefined, so breaking the sum into inflation tiles we obtain The result then follows by applying Lemma 2.9 to bound |v| a , noting that for all a ∈ A we have s∈ϑ(a) P[ϑ P (a) = s] q ≤ 1 if q ≥ 1 and s∈ϑ(a) P[ϑ P (a) = s] q ≥ 1 if q ≤ 1. □ 2.8.Frequency measures.The main object that we associate with a given primitive random substitution ϑ P is the frequency measure µ P .This measure quantifies the relative occurrence of a given word in a random substitution.We now define this measure precisely.First, we define the expected frequency of a word v ∈ L ϑ by , where, by primitivity, this limit is independent of the choice of a ∈ A. In fact, we have the stronger property that the word frequencies exist P-almost surely in the limit of large inflation words and are given by freq(v) for all v ∈ L ϑ (see [GS20] for further details).Recalling that ξ(X ϑ ) is the algebra of cylinder sets on X ϑ that specify the origin, we define µ P : ξ(X ϑ ) ∪ {∅} → [0, 1] by µ P (∅) = 0, µ P (X ϑ ) = 1, and µ P ([v] m ) = freq(v) for v ∈ L ϑ and m ∈ {1 − |v|, 2 − |v|, . . ., 0}.This set function extends to a unique measure (c.f.[GS20, Proposition 5.3 and Theorem 5.9])

Proposition 2.11 ([GS20]
).The set function µ P is a content with mass one which extends uniquely to a shift-invariant ergodic Borel probability measure on X ϑ .
We call the measure µ P defined in Proposition 2.11 the frequency measure corresponding to the random substitution ϑ P .Note that frequency measures are dependent on the probabilities of the substitution.As such, for the subshift of a primitive random substitution that is non-deterministic, there exist uncountably many frequency measures supported on this subshift [GS20].In contrast, the subshift of a primitive deterministic substitution has precisely one frequency measure, which is the unique ergodic measure [Que87].
Frequency measures corresponding to primitive and compatible random substitutions satisfy the following renormalisation lemma, which relates the measure of a cylinder set of a legal word to measures of cylinder sets of shorter words via the production probabilities of the random substitution.This result first appeared in [GS20] and is central to the proof of the main result in [GMR+23].
Lemma 2.12 (Renormalisation).Let ϑ P be a primitive and compatible random substitution with corresponding frequency measure µ P .Let n ∈ N and let k be an integer such that every Lemma 2.12 is plays an important role in the proof of Theorem A, as it relates the sums u∈L n ϑ µ P ([u]) to sums over smaller words via the production probabilities.This in turn allows us to obtain relations between τ µ P and φ k .Under additional assumptions, simplified reformulations of Lemma 2.12 can be obtained (see, for example, Lemma 2.18, which is used in Theorem D).

Separation conditions and recognisability.
In this section, we introduce additional common assumptions which either (1) impose a certain separation on inflation words, or (2) impose a certain uniformity on the inflation and the probabilities.Under these conditions, we can obtain closed-form formulas for the L q -spectrum.Definition 2.13.A random substitution ϑ P = (ϑ, P ) satisfies the disjoint set condition if for all a ∈ A and k ∈ N.Moreover, we say that ϑ P has identical production probabilities if for all a ∈ A, k ∈ N and v ∈ ϑ k (a), for all u 1 and u 2 ∈ ϑ(a).
A consequence of the disjoint set condition is that for every a ∈ A, k ∈ N and w ∈ ϑ k (a), there is a unique v ∈ ϑ k−1 (a) such that w ∈ ϑ(v).In other words, every exact inflation word can be uniquely de-substituted to another exact inflation word.The following definition extends this idea of unique de-substitution from inflation words to all elements in the subshift.Definition 2.14.Let ϑ P = (ϑ, P ) be a primitive and compatible random substitution.We call ϑ P recognisable if for every x ∈ X ϑ there exists a unique The following follows routinely from the definition of recognisability (a proof is given in [GMR+23, Lemma 4.5]).
Lemma 2.15.If ϑ P is a primitive, compatible and recognisable random substitution, then ϑ P satisfies the disjoint set condition.
In contrast to the disjoint set condition, recognisability is stable under taking powers (see [GMR+23, Lemma 4.6]).Lemma 2.16.Let ϑ P be a primitive and compatible random substitution and m ∈ N. If ϑ P is recognisable, then so is ϑ m P .
An alternative characterisation of recognisability is the following local version.Intuitively, local recognisability means that applying a finite window to a sequence is enough to determine the position and the type of the inflation word in the middle of that window.The following result is given in [GMR+23, Lemma 4.4] (see also [FRS22+, Proposition 5.7]).
As a consequence of this local characterisation of recognisability, for every legal word u with length greater than twice the radius of recognisability there exists an inflation word w, appearing as a subword of u, which has a unique decomposition into exact inflation words.We call the largest such w the recognisable core of u.
Local recognisability allows us to obtain a stronger version of Lemma 2.12 for recognisable random substitutions.This result is key to obtaining the coincidence of the L q -spectrum and its inflation word analogue under recognisability for q < 0, and thus the conclusion of Theorem D.

L q -SPECTRA OF FREQUENCY MEASURES
In this section, we prove our main results on L q -spectra of frequency measures.
Here, we relate the L q -spectrum to a certain "symbolic" L q -spectrum, which we call the inflation word L q -spectrum.Heuristically, the inflation word L q -spectrum is the natural guess for the L q -spectrum if you do not account for non-uniqueness in the positions in which legal words can appear in inflation words.This notion is introduced in §3.1, where we also state and prove some of its key properties.
In particular, in Proposition 3.1, we prove a simple closed-form formula for the inflation word L q -spectrum under the disjoint set condition or the identical set condition with identical production probabilities.In Proposition 3.2, we establish basic monotonicity results.Then, in §3.2 and §3.3, we establish the general bounds for the L q -spectrum in terms of the inflation word L q -spectrum, giving Theorem A (the proof is given in §3.4).We also prove that this bound is sharp in §3.5 under recognisability.This proves the first part of Theorem D. However this bound need not hold in general: we discuss a counterexample in Example 5.2.Finally, in §3.6, we prove differentiability of the L q -spectrum at q = 1 and show how to recover known results for measure theoretic and topological entropy from our results concerning L q -spectra.
3.1.Inflation word L q -spectra.Given a primitive random substitution ϑ P = (ϑ, P ), we can define an analogue of the L q -spectrum in terms of its production probabilities, in a similar manner to the inflation word analogue of entropy introduced in [GMR+23].In many cases, this notion coincides with the L q -spectrum of the frequency measure associated to ϑ P .For each k ∈ N and q ∈ R, define where R = (R a ) a∈A is the right Perron-Frobenius eigenvector of the substitution matrix of ϑ P .We define the inflation word L q -spectrum of ϑ P by We recall that λ is the spectral radius of the substitution matrix associated with the random substitution.We similarly define the upper variant T ϑ,P by taking a limit supremum in place of the limit infimum.We first state some key properties of T ϑ,P (q) which follow easily from the definition.Firstly, if the random substitution ϑ P is compatible and satisfies either the disjoint set condition or the identical set condition with identical production probabilities, then the limit defining T ϑ,P (q) exists for all q ∈ R and is given by a closed-form expression.For q ≥ 0, these properties transfer to the L q -spectrum by Theorem A. Proposition 3.1.Let ϑ P be a primitive and compatible random substitution and q ∈ R. If ϑ P satisfies the disjoint set condition, then the limit defining T ϑ,P (q) exists and If ϑ P satisfies the identical set condition and has identical production probabilities, then the limit defining T ϑ,P (q) exists and Proof.Fix q ∈ R. By the Markov property of ϑ P , for all a ∈ A, k ∈ N and v ∈ ϑ k (a), First, suppose ϑ P satisfies the disjoint set condition.Then for every v ∈ ϑ k (a) there is a unique s(v) ∈ ϑ(a) such that v ∈ ϑ k−1 (s(v)).Thus, for all s ∈ ϑ(a) such that s ̸ = s(v), we have P[ϑ k−1 P (s) = v] = 0, and so it follows by (3.1) that where in the final equality we use compatibility to split the second sum into inflation tiles.Thus so the limit defining T ϑ,P (q) exists and is equal to (λ − 1) −1 φ 1 (q).
Next, suppose ϑ P satisfies the identical set condition and has identical production probabilities.Then P[ϑ k−1 P (s 1 ) = u] = P[ϑ k−1 P (s 2 ) = u] for all s 1 , s 2 ∈ ϑ(a).Hence, it follows by (3.1) that v∈ϑ k (a) for any choice of s ∈ ϑ(a).By compatibility and the independence of the action, , and thus It follows by induction that φ k (q)/λ k = φ 1 (q)/λ for all k ∈ N, so we conclude that T ϑ,P (q) exists and equals λ −1 φ 1 (q).□ Proposition 3.2.Let ϑ P be a primitive and compatible random substitution.For all q > 1 and q < 0, the sequence (λ −k φ k (q)) k is non-decreasing; and for all 0 < q < 1, the sequence is non-increasing.
Proof.This is largely a consequence of Jensen's inequality.Note that on the interval (0, 1], the function x → x q is convex if q > 1 or q < 0, and concave if 0 < q < 1.We first prove this for the case when q > 1 or q < 0. For all a ∈ A, k ∈ N with k ≥ 2 and v ∈ ϑ k (a), it follows by the Markov property of ϑ P that In the second line, we apply Jensen's inequality, and in the third line, we use compatibility to decompose each probability P[ϑ k−1 P (s) = w] into inflation tiles.It follows that The 0 < q < 1 case follows similarly, with Jensen's inequality giving the opposite inequality since x → x q is concave.□ An analogous monotonicity result does not hold in general for the (λ k − 1) −1 φ k (q) bounds, even when q ≥ 0. A counterexample is given by the random period doubling substitution (Example 5.7) with non-uniform probabilities.
3.2.L q -spectra for non-negative q.The majority of the work in proving Theorem A lies in proving the bounds in (1.1), (1.2) and (1.3).It suffices to prove the bound for the case k = 1, since we then obtain the bound for other k ∈ N by considering higher powers of the random substitution.We first prove the upper bound for the case q > 1.
Throughout this section, we assume that the random substitution is primitive and compatible.Proposition 3.3.For all q > 1, Proof.Fix q > 1.Let ε > 0 and, for each n ∈ N, let m(n) be the integer defined by Then the integers n and m(n) satisfy the conditions of Lemma 2.12, so it follows that Since q > 1, the function x → x q is superadditive on the interval [0, 1], so We now bound the probability on the right of this expression by the production probability of an inflation word.If w(u) ∈ ϑ(v) contains u as a subword in position for all j ∈ {1, . . ., |ϑ(v 1 )|}.Since ϑ P is compatible, by Lemma 2.10 there exists an N ∈ N such that for all n ≥ N and all v ∈ L m(n) ϑ w∈ϑ(v) . Hence, Taking logarithms, rearranging and dividing by n gives Noting that m(n)/n → (λ − ε) −1 as n → ∞, it follows by Lemma 2.2 that where c := (#A) max a∈A log( s∈ϑ(a) P[ϑ P (a) = s] q ).But ε > 0 was arbitrary; letting ε → 0 and rearranging we obtain which completes the proof.□ We now prove the corresponding lower bound.
Proposition 3.4.For all q > 1, Proof.Let ε > 0 and, for each n ∈ N, let m(n) be the integer defined by Since q > 1, the function x → x q is convex on the interval [0, 1].Hence, it follows by Lemma 2.12 and two applications of Jensen's inequality that We bound above the probability on the right of this expression by the production probability of a sufficiently large inflation word contained in u.By compatibility, there is an integer k , where lim k(n)/n = 0.In particular, for every v ∈ L n ϑ , a realisation of ) is contained in u as an inflation word, so We now bound this quantity uniformly for all v ∈ L m(n) ϑ . By Lemma 2.10 and the above, there is an N ∈ N such that for all n ≥ N .
Taking logarithms, rearranging and dividing by n gives But ε > 0 was arbitrarily, so which completes the proof.□ We now state the bounds for the q ∈ (0, 1) case.We do not give a proof here since the arguments mirror the proofs of Proposition 3.3 and Proposition 3.4, except with reversed inequalities since x → x q is concave rather than convex and subadditive as opposed to superadditive.Proposition 3.5.If q ∈ (0, 1), then 3.3.L q -spectra for negative q: lower bounds.For q < 0, there exist primitive and compatible random substitutions for which τ µ P (q) and T ϑ,P (q) do not coincide (see, for instance, Example 5.2).However, we still obtain that τ µ P (q) ≥ T ϑ,P (q) for all q < 0. To prove this, it suffices to show the sequence of bounds in (1.3) holds.Again, we only need to prove the bound for k = 1 since the remaining bounds follow by considering powers of the random substitution.
Proposition 3.6.If ϑ P is a primitive and compatible random substitution, then for all q < 0, Proof.Let ε > 0 be sufficiently small and for n sufficiently large, let m(n) be the integer defined by To avoid division by zero, we rewrite Lemma 2.12 in a form where we do not sum over elements equal to zero.Here, we write u ◀ ϑ(v) to mean there is a realisation w of ϑ(v) for which u appears as a subword of w.
and if u does not appear as a subword of any realisations of ϑ(v), then J (u, v) = ∅.Therefore, we can rewrite Lemma 2.12 as Hence, by the subadditivity of the function x → x q on the domain (0, 1], For each j ∈ J (v, u), let w j (u) ∈ ϑ(v) be a word such that w j (u) [j,j+n−1] = u.Note that there are at most and it follows that Thus, by Lemma 2.10, for all ε > 0 there is an integer N such that for all n ≥ N Taking logarithms, rearranging and dividing by n gives Noting that m(n)/n → (λ − ε) −1 as n → ∞, it follows by Lemma 2.2 that where c := (#A) max a∈A log( s∈ϑ(a) P[ϑ P (a) = s] q ).Letting ε → 0 and rearranging, we obtain which completes the proof.□ 3.4.Proof of general bounds for the L q spectrum.Using the bounds proved in the prior two sections, we can now complete the proof of Theorem A.
Proof (of Theorem A).Since, for each k ∈ N, the random substitution ϑ k P gives rise to the same frequency measure as ϑ P , applying Proposition 3.3, Proposition 3.4 and Proposition 3.5 to for all q > 1 and for 0 < q < 1. Letting k → ∞ gives for all q ∈ (0, 1) ∪ (1, ∞), so the limits defining τ µ P (q) and T ϑ,P (q) both exist and coincide.The same holds for q = 0 and q = 1 by continuity.The monotonicity of the bounds λ −k φ k (q) follows by Proposition 3.2.Finally for q < 0, for each k ∈ N, applying Proposition 3.6 to ϑ k P gives that Passing to the limit completes the proof.□ 3.5.L q -spectra for negative q under recognisability.While the upper bound does not hold in general for q < 0, for recognisable random substitutions we can obtain this using Lemma 2.18, which we recall is a refinement of Lemma 2.12 using recognisability.
Proposition 3.7.If ϑ P is a primitive, compatible and recognisable random substitution, then for all q < 0, Proof.Let ε > 0 be sufficiently small and, for each n ∈ N sufficiently large, let m(n) be the integer defined by , let w(u) denote the recognisable core of u.Further, let v(u) denote the unique legal word such that w(u) ∈ ϑ(v(u)).Then, by Lemma 2.18, For all u ∈ L n+2κ(ϑ) ϑ , the recognisable core w(u) has length at least n so, by compatibility, there is an integer . In particular, for every u there exists a v ∈ L Hence, it follows by (3.2) and Lemma 2.10 that noting that since q < 0, the function x → x q is decreasing on (0, 1].Taking logarithms, rearranging and dividing by n gives Noting that m(n)/n → (λ − ε) −1 as n → ∞, it follows by Lemma 2.2 that where c := (#A) max a∈A log( s∈ϑ(a) P[ϑ P (a) = s] q ).Letting ε → 0 and rearranging, we obtain which completes the proof.□ 3.6.Recovering entropy from the L q -spectrum.Since the L q -spectrum encodes both topological and measure theoretic entropy, Theorem A provides an alternative means of proving the coincidence of these quantities with the inflation word analogues introduced in [GMR+23; Goh20] for primitive and compatible random substitutions.For notational simplicity, set Proof (of Corollary C).We first establish the result for topological entropy.By Theorem A, the limit defining T ϑ,P (0) exists; in particular, exists.Since h top (X ϑ ) = −τ µ P (0) = −T ϑ,P (0), we conclude that as claimed.
Now we consider measure theoretic entropy.We first make the following elementary observation: if f and g are concave functions with f (1) = g(1) and f (x) ≤ g(x) for all x ≥ 1, then f + (1) ≤ g + (1).Indeed, for all ϵ > 0, and taking the limit as ϵ goes to 0 (which always exists by concavity) yields the desired inequality.

RECOGNISABILITY AND THE MULTIFRACTAL FORMALISM
In this section we establish the multifractal formalism as stated in Theorem D. Our proof will follow from a constrained variational principle, which is obtained by considering typical local dimensions of one frequency measure µ P relative to another frequency measure µ Q .Our strategy is to prove the almost sure existence of relative letter frequencies in Lemma 4.3: this result, combined with recognisability, gives Proposition 4.5.The multifractal formalism then follows from this dimensional result combined with the formula for the L q -spectrum proved in Proposition 3.7-the proof is given in §4.2.

Non-typical local dimensions.
To prove the multifractal formalism for a given frequency measure µ P , we show that for every α ∈ [α min , α max ], there exists another frequency measure µ Q such that dim H µ Q ≥ τ * µ P (α) and dim loc (µ P , x) = α for µ Q -almost every x ∈ X ϑ .Given a primitive set-valued substitution ϑ, permissible probabilities P and Q, m ∈ N and a ∈ A, define the quantity H m,a P ,Q (ϑ) by Further, let H m P ,Q (ϑ) denote the vector (H m,a P ,Q (ϑ)) a∈A .We first prove some properties of the quantity H m P ,Q (ϑ) which we will use in the proof of Proposition 4.5.
Lemma 4.1.If ϑ is a primitive and compatible set-valued substitution and P and Q are permissible probabilities, then for all m ∈ N, a ∈ A and s ∈ ϑ(a), Proof.Since ϑ is compatible, we can decompose each v ∈ ϑ m (s) into inflation . By the Markov property of ϑ P (respectively ϑ Q ), Therefore Proof.Since ϑ satisfies the disjoint set condition, for all m ∈ N and a ∈ A, In the second equality we use the Markov property of ϑ P and ϑ Q , laws of logarithms, and that v∈ϑ m (s) P[ϑ m Q (s) = v] = 1 for all s ∈ ϑ(a); in the third we apply Lemma 4.1; in the fourth we use that M ϑ R = λR.Applying the above inductively, which completes the proof.□ Any bi-infinite sequence x in the subshift of a recognisable random substitution can be written as a bi-infinite concatenation of exact inflation words (w n,an ), where w n,an is an inflation word generated from the letter a n .Given a recognisable setvalued substitution ϑ, a ∈ A and w ∈ ϑ(a), we define the inflation word frequency of (a, w) in x ∈ X ϑ by #{m : a m = a, w m,am = w, w m,am in x [−n,n] }, provided the limit exists.For a given frequency measure µ P , the inflation word frequency of a µ P -typical word is determined by the production probabilities.
More specifically, we have the following.
Lemma 4.3.Let ϑ P = (ϑ, P ) be a primitive, compatible and recognisable random substitution with corresponding frequency measure µ P .For µ P -almost every x ∈ X ϑ , the inflation word frequency exists and is given by for all a ∈ A and w ∈ ϑ(a).
Proof.Let A a,w be the set of points x ∈ X ϑ such that the above does not hold.We show that A a,w is a null set.Taking the complement and then the intersection over all a, w gives a full-measure set with the required property.Given ε > 0, let E(n, ε) be the set of x ∈ X ϑ such that By the Borel-Cantelli lemma, it suffices to show that n∈N µ P (E(n, ε)) < ∞ for all ε > 0 in order to conclude that A a,w is a nullset.To this end, we show that µ P (E(n, ε)) decays exponentially with n.Given u with |u| = 2n + 1 > 2κ(ϑ), let u R denote the recognisable core of u, which has length at least |u| − 2κ(ϑ).Lemma 2.18 gives that where each w i,v i is the inflated image of v i in u R .By compatibility, we can choose an integer N such that every v of length at least N satisfies |v|(R a − ε/3) ≤ |v| a ≤ |v|(R a +ε/3) for all a ∈ A. For each v and a ∈ A, let A a (v) denote the set of u ′ ∈ ϑ(v) such that the frequency of indices i ∈ {j : a j = a} with w i,a = w deviates from P[ϑ P (a) = w] by more than ε/3.Since ϑ P acts independently on letters, it follows by Cramér's theorem that the sum u ′ ∈A(v) P[ϑ P (v) = u ′ ] decays exponentially with |v| a (and hence with |v|).In particular, there is a constant C > 0, independent of the choice of v, such that (4.1) Note that if u is a sufficiently long legal word and has [u] ∩ E(n, ε) = ∅, then we require that u R ∈ A(v).Indeed, if u ′ / ∈ A(v) and |v| ≥ N , then the relative inflation word frequency of w is bounded above by and, similarly, bounded below by Let V n denote set of all words which appear as the (unique) preimage of the recognisable core of a word of length n.It then follows by Lemma 2.18 that where in the final inequality we have used (4.1) and that absorbing this contribution and the κ(ϑ)/λ factor into the constant C. It follows that and the result then follows by the Borel-Cantelli lemma.□ Finally, we require the following bounds on the exponential scaling rate of measures of cylinders, which is essentially a consequence of Theorem A. In particular, these give bounds on the possible local dimensions of the measure.Proposition 4.4.If ϑ P is a primitive and compatible random substitution with corresponding frequency measure µ P , then there are values 0 < s 1 < s 2 < ∞ and c 1 , c 2 > 0 such that for all n ∈ N and v ∈ L n (X ϑ ) = L n ϑ , Proof.By Theorem A, for all k ∈ N and q > 1, and for q < 0, Moreover, for each k, with it follows that [β k,min , β k,max ] ⊂ (0, ∞) is a decreasing nested sequence of intervals, so with β min = lim k→∞ β k,min and β max = lim k→∞ β k,max , Applying Lemma 2.1(b) gives the result.□ Finally, we obtain our main conclusion concerning relative local dimensions.
Proposition 4.5.Let ϑ be a primitive, compatible and recognisable set-valued substitution, let P and Q be permissible probabilities, and let µ P and µ Q denote the respective frequency measures.Then, for µ Q -almost all x ∈ X ϑ , with the same convergence holding for u n + (x) by identical arguments.Thus, it follows from (4.3) that Since the above holds for all m ∈ N, by letting m → ∞ it follows by Lemma 4.2 that dim loc (µ P , x) exists and which completes the proof.□

Proof of the multifractal formalism.
In this section, we apply the results obtained in the previous section, along with results on the L q -spectrum under recognisability, to prove Theorem D.
We now obtain the results on the multifractal spectrum.In light of Proposition 2.3, it remains to show that f µ P (α) ≥ τ * µ P (α) for each α ∈ R. As proved above, for all q ∈ R, where for each a ∈ A First, fix α ∈ (α min , α max ) and let q ∈ R be chosen so that τ ′ µ P (q) = α.Observe that qα − τ µ P (q) = τ * µ P (α).Then define Q by the rule for all a ∈ A and s ∈ ϑ(a).Then by Corollary C, In fact, this shows that dim loc (µ P , x) = α for µ Q -almost all x ∈ X ϑ by Proposition 4.5.Thus f µ P (α) ≥ dim H µ Q = τ * µ P (α), as required.The result for α = α min (resp.α = α max ) follows similarly by taking a degenerate probability vector Q assigning equal value to the realisations of ϑ(a) with maximal (resp.minimal) probabilities given by P , and zero otherwise.The corresponding non-degenerate sub-substitution is also compatible and recognisable, so the same arguments yield the corresponding bounds.□

EXAMPLES, COUNTEREXAMPLES AND APPLICATIONS
5.1.Failure of bounds for negative q without recognisability.In the following two examples, we show the results in Theorem A do not extend in general to give an upper bound for the L q -spectrum in terms of the inflation word L q -spectrum, for q < 0. In Example 5.1, we construct a class of frequency measures on the full-shift on two letters for which the L q -spectrum and inflation word analogue differ in the q < 0 case.The random substitutions that give rise to these frequency measures are not compatible, but in Example 5.2 we present a compatible analogue.In contrast, in Example 5.3, we give an example showing that the results for q < 0 can hold for all q ∈ R under the identical set condition with identical production probabilities.
Example 5.1.Let p 1 < p 2 ∈ (0, 1) such that p 1 + 3p 2 = 1 and let ϑ P be the random substitution defined by ab with probability p 1 ba with probability p 2 aa with probability p 2 bb with probability p 2 We show for all sufficiently small q < 0 that τ µ P (q) > T ϑ,P (q).Observe that, for each k ∈ N, the word v k = (ab) 2 k ∈ ϑ k+1 (a) ∩ ϑ k+1 (b) occurs with probability Clearly, this is the minimal possible probability with which a level-k inflation word can occur, so it follows that /2.Since ϑ(a) = ϑ(b) with identical production probabilities, it follows by Lemma 2.12 that for any choice of w , then we are done, otherwise at least half of the letters in v must be sent to ab.But then for u to appear from the second letter, at least half of the letters in v must be sent to ba or bb, so P By a slight modification of this example, we can construct a compatible random substitution for which the two notions do not coincide.
Example 5.2.Let p 1 < p 2 ∈ (0, 1) such that p 1 + 3p 2 = 1 and let ϑ P be the random substitution defined by ab ba with probability p 1 ba ab with probability p 2 ab ab with probability p 2 ba ba with probability p 2 By similar arguments to the previous example, we obtain The random substitution in Example 5.2 satisfies the identical set condition with identical production probabilities.These conditions are also satisfied by the following example.However, here the L q -spectrum and inflation word analogue coincide for all q ∈ R by a direct argument.
Since ϑ(v 1 ) = ϑ(v 2 ) for all v 1 , v 2 ∈ L ϑ , it follows from Lemma 2.12 that for all u ∈ L 2m ϑ and any v ∈ L m+1 Now, for every w ∈ ϑ(v 2 • • • v m ) there is a u such that w = u [3−j(u),2−j(u)+2m] .Hence, and the conclusion follows by similar arguments to those used in the proofs of the main theorems.

Examples with recognisability.
We first provide examples of random substitutions for which the multifractal formalism holds.One can verify that ϑ is recognisable since every occurrence of aa intersects an image of b and the adjacent letters then determine the cutting points.Thus by Theorem D, for all q ∈ R τ µp (q) = T ϑ,P (q) = 1 λ − 1 φ 1 (q) = − 7 − √ 17 8 log(p q + (1 − p) q ) and measure µ p satisfies the multifractal formalism.The asymptotes have slopes −(7 − √ 17) log(p)/8 and −(7 − √ 17) log(1 − p)/8.A plot of the L q -spectra and multifractal spectra for two choices of p is given in Figure 1.
For p = 1/2, the L q -spectrum of the measure µ p is a straight line and the multifractal spectrum is equal to h top (X ϑ ) at h top (X ϑ ), and −∞ otherwise.
In the following example, we highlight that the multifractal spectrum need not have value 0 at the endpoints.(B) Multifractal spectra FIGURE 2. L q -spectra and multifractal spectra corresponding to a recognisable substitution for p ∈ {1/5, 2/5}.
Here, we highlight that the endpoints of the multifractal spectrum need not be equal to zero.
Example 5.6.Consider the random substitution on the three-letter alphabet A = {a, b, c} defined by a → bbc with probability p 1 cbb with probability 1 − p 1 b → cca with probability p 2 acc with probability 1 − p 2 c → aab with probability p 3 baa with probability 1 − p 3 for p 1 , p 2 , and p 3 in (0, 1).It is immediate that this substitution is compatible, and by considering the occurrences of 2, 3, or 4 letter repetitions, we see that this substitution is also recognisable.Moreover, the hypotheses of [GMR+23, Theorem 4.8] are satisfied since ϑ is constant length and #ϑ(a) = #ϑ(b) = #ϑ(c).
In particular, the corresponding subshift X ϑ is intrinsically ergodic with unique measure of maximal entropy given by taking p 1 = p 2 = p 3 = 1/2.It follows from [GMR+23, Lemma 4.12] that the measure of maximal entropy is not a Gibbs measure with respect to the zero potential, so the system does not satisfy the usual specification property.For this choice of uniform probabilities, the L q -spectrum is a straight line passing through the point (1, 0) with slope h top (X ϑ ) = log(2)/2.More generally, the L q -spectrum is given for all q ∈ R by the formula τ µ P (q) = − 1 6 log (1 − p 1 ) q + p q 1 + log (1 − p 2 ) q + p q 2 + log (1 − p 3 ) q + p q 3 and the multifractal formalism is satisfied.
For an example on an alphabet of size two, one may consider the random substitution ϑ P : a → ababbb with probability p 1 abbabb with probability 1 − p 1 b → baabaa with probability p 2 babaaa with probability 1 − p 2 for p 1 and p 2 in (0, 1).The analysis of this example proceeds identically as above.

Examples without recognisability.
Finally, we consider the two most commonly studied examples of random substitutions: random period doubling and random Fibonacci.
Since the substitution satisfies the disjoint set condition but is not recognisable, our results do not give the L q -spectrum for q < 0. does not satisfy either the identical set condition nor the disjoint set condition.Hence, we cannot apply Corollary B to obtain a closed-form formula for τ µp (q).However, we can still apply Theorem A to obtain a sequence of lower and upper bounds.The case k = 1 gives the following bounds for all 0 < q < 1: − 1 ϕ 2 log(p q + (1 − p) q ) = 1 ϕ φ 1 (q) ≤ τ µp (q) ≤ 1 ϕ − 1 φ 1 (q) = − log(p q + (1 − p) q ), . Upper and lower bounds on the L q -spectrum of the frequency measure corresponding to the random Fibonacci substitution with p = 1/2, for k = 3, 5, 7. The darker shades correspond to higher values of k.
where ϕ denotes the golden ratio.Reversing the inequalities yields the corresponding bounds for q > 1.Of course, by considering larger k we can obtain better bounds.For p = 1/2, some bounds given by Theorem A are shown in Figure 3.